import { ClassicsService } from './classics.service';
import { Controller, Get, Post, Body, Patch, Param, Delete,Query,Req,UseGuards} from '@nestjs/common';
import { CreateClassicsDto} from './dto';
import { LoginGuard } from '../../login/login.guard';
@Controller('classics')
export class ClassicsController {
  constructor(private readonly classicsService: ClassicsService) {}

  @UseGuards(LoginGuard)
  @Post('/add')
  create(@Body() CreateClassicsDto: CreateClassicsDto) {
    return this.classicsService.create(CreateClassicsDto);
  }

  //@UseGuards(LoginGuard)
  @Post('/addJson')
  importByJson(@Body() data:[]) {
    return this.classicsService.createJson(data);
  }
}
